/*
 * @Author: szx
 * @Date: 2022-05-09 14:25:00
 * @LastEditTime: 2022-05-09 14:26:30
 * @Description:
 * @FilePath: \leetcode\900-999\942\942.js
 */
/**
 * @param {string} s
 * @return {number[]}
 */
var diStringMatch = function (s) {
    const res = [];
    let i = 0,
        j = s.length;
    for (let ch of s) res.push(ch === 'I' ? i++ : j--);
    return res;
};
